@extends('admin.layout')

@section('content')
    <body class="hold-transition skin-blue sidebar-mini">
    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section>
            <ol class="breadcrumb">
                <li><a href="#"><i class="fa fa-dashboard"></i> 首页</a></li>
                <li><a href="#">管理员</a></li>
                <li class="active">添加兑换专员</li>
            </ol>
        </section>
        <!-- Main content -->
        <section class="content">
            <div class="row">
                <!-- left column -->
                <div class="col-md-12" style="width: 100%;">
                    <!-- general form elements -->
                    <div class="box box-primary">
                        <div class="box-header with-border">
                            <h3 class="box-title"></h3>
                        </div>
                        <!-- /.box-header -->
                        <span id="msg" style="display: none">
                            @if (count($errors) > 0)
                                @foreach ($errors->all() as $error)
                                    <div style="width: 100%;">
                                        <span style="color: red;display: block;margin: 0px auto;width: 200px;text-align: center;">{{ $error }}</span>
                                    </div>
                                @endforeach
                            @endif
                        </span>
                        <script type="text/javascript">
                            var _msg = $('#msg div span').text();
                            console.log(_msg);
                            if(_msg != ''){
                                layer.msg(_msg);
                            }
                        </script>
                        <!-- form start -->
                        <form  action="{{ url('admin/change') }}" method="post">
                            {{ csrf_field() }}
                            <div class="box-body" style="width: 50%;">
                                <div class="form-group">
                                    <label for="exampleInputEmail1">兑换专员名称</label>
                                    <input type="text" name="name" class="form-control" id="exampleInputEmail1" placeholder="manage name">
                                </div>
                                <div class="form-group">
                                    <label for="exampleInputEmail1">密码</label>
                                    <input type="password" name="password" class="form-control" id="exampleInputEmail1" placeholder="manage password">
                                </div>
                                <div class="form-group">
                                    <label for="exampleInputEmail1">兑换专员邮箱</label>
                                    <input type="text" name="email" class="form-control" id="exampleInputEmail1" placeholder="manage email">
                                </div>
                                <div class="form-group">
                                    <label for="exampleInputEmail1">兑换专员电话</label>
                                    <input type="text" name="phone" class="form-control" id="phone " placeholder="manage phone">
                                </div>

                                <div class="form-group" >
                                    <label for="exampleInputEmail1">所属业务经理：</label>
                                    <select name="man">
                                        @foreach($list as $value)
                                            <option value="{{ $value['id'] }}">{{ $value['username'] }}</option>
                                        @endforeach
                                    </select>
                                </div>
                                {{--<div class="form-group">--}}
                                {{--<label for="exampleInputEmail1">添加客户经理</label><br />--}}
                                {{--@foreach($man as $value)--}}
                                {{--<input type="checkbox" name="man[]" value="{{ $value['id'] }}">{{ App\Partner::find($value['par_id'])['name'] }}--{{ $value['username'] }}<s style="margin-left: 30px"></s>--}}
                                {{--@endforeach--}}
                                {{--</div>--}}
                            </div>
                            <!-- /.box-body -->

                            <div class="box-footer">
                                <button type="submit" class="btn btn-primary">提交客户</button>
                            </div>
                        </form>
                    </div>
                    <!-- /.box -->

                </div>

                <!--/.col (right) -->
            </div>
            <!-- /.row -->
        </section>
        <!-- /.content -->
    </div>
    <!-- /.content-wrapper -->
@stop
